using imitateMacQQ.WebApi.Domain.CircleServe.Entity.dao;
using imitateMacQQ.WebApi.Domain.CircleServe.Entity.dto;
using imitateMacQQ.WebApi.Domain.CircleServe.Interface;
using imitateMacQQ.WebApi.Domain.Request.utils;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace imitateMacQQ.WebApi.Api.Circle;

[ApiController]
[Route("api/[controller]/[action]")]
public class CircleTalkController : ControllerBase
{
    private readonly ITalkInfo _talkInfo;

    public CircleTalkController(ITalkInfo talkInfo)
    {
        _talkInfo = talkInfo;
    }

    [Authorize]
    [HttpPost]
    public async Task<Request<bool>> SendTalk(TalkRemark dto)
    {
        return await _talkInfo.SendRemarks(dto);
    }

    [Authorize]
    [HttpGet]
    public async Task<Request<bool>> DelTalk(string uid)
    {
        return await _talkInfo.DelRemarks(uid);
    }

    [Authorize]
    [HttpGet]
    public async Task<Request<UsrTalk[]>> GetTalkOnly(string send, string accept,
        string remark)
    {
        return await _talkInfo.GetUsrTalk(send, accept, remark);
    }

    [HttpGet]
    public async Task<Request<UsrTalk[]>> GetTalkAll(string remark)
    {
        return await _talkInfo.GetAllTalk(remark);
    }
}